import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    name: "home",
    path: "/home",
    meta: {
      keepAlive: true,
    },
    component: () => import("../views/home/home.vue"),
  },
  {
    name: "endRecord",
    path: "/endRecord",
    component: () => import("../views/home/endRecord/endRecord.vue"),
  },
  {
    name: "detail",
    path: "/detail",
    component: () => import("../views/home/detail/detail.vue"),
  },
  {
    name: "userCenter",
    path: "/userCenter",
    component: () => import("../views/home/userCenter/userCenter.vue"),
  },
  {
    name: "workDetail",
    path: "/workDetail",
    component: () => import("../views/home/workDetail/workDetail.vue"),
  },
  {
    name: "sendBook",
    path: "/sendBook",
    component: () => import("../views/user/sendBook/sendBook.vue"),
  },
  {
    name: "order",
    path: "/order",
    component: () => import("../views/order/order.vue"),
  },
  {
    name: "orderDetail",
    path: "/orderDetail",
    component: () => import("../views/order/orderDetail/orderDetail.vue"),
  },
  {
    name: "msg",
    path: "/msg",
    component: () => import("../views/msg/msg.vue"),
  },
  {
    name: "user",
    path: "/user",
    component: () => import("../views/user/user.vue"),
  },
  {
    name: "money",
    path: "/money",
    component: () => import("../views/user/money/money.vue"),
  },
  {
    name: "book",
    path: "/book",
    component: () => import("../views/user/book/book.vue"),
  },
  {
    name: "save",
    path: "/save",
    component: () => import("../views/user/save/save.vue"),
  },
  {
    name: "numSet",
    path: "/numSet",
    component: () => import("../views/user/numSet/numSet.vue"),
  },
  {
    name: "auth",
    path: "/auth",
    component: () => import("../views/user/auth/auth.vue"),
  },
  {
    name: "orderSet",
    path: "/orderSet",
    component: () => import("../views/user/orderSet/orderSet.vue"),
  },
  {
    name: "about",
    path: "/about",
    component: () => import("../views/user/about/about.vue"),
  },
  {
    name: "report",
    path: "/report",
    component: () => import("../views/user/report/report.vue"),
  },
  {
    name: "joinUs",
    path: "/joinUs",
    component: () => import("../views/user/joinUs/joinUs.vue"),
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  // scrollBehavior(to, from, savedPosition) {
  //   // 始终滚动到页面顶部
  //   return { x: 0, y: 0 };
  // },
  routes,
});

export default router;
